//
//  ScreenInvoiceClaimView.m
//  NtoccShipper
//
//  Created by 张天兴 on 2023/4/26.
//  Copyright © 2023 zhuchongjin. All rights reserved.
//

#import "ScreenInvoiceClaimView.h"

@implementation ScreenInvoiceClaimView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self addSubview:self.bgView];
    }
    return self;
}
-(UIView *)bgView{
    if (_bgView == nil) {
        self.bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
        self.bgView.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.6];
        [self.bgView addSubview:self.drawerView];
        self.changeVoidceSet = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(changeVoidceSet:)];
        [self.bgView addGestureRecognizer:self.changeVoidceSet];
    }
    return _bgView;
}
- (UIView *)drawerView{
    if (_drawerView == nil) {
        self.drawerView = [[UIScrollView alloc] initWithFrame:CGRectMake(SCREEN_WIDTH/4, 0, SCREEN_WIDTH/4*3, SCREEN_HEIGHT)];
        self.drawerView.backgroundColor = [UIColor whiteColor];
        [self.drawerView addSubview:self.titleLabel];
        [self.drawerView addSubview:self.linesLabel];
        [self.drawerView addSubview:self.nameLabel];
        [self.drawerView addSubview:self.nameTextField];
        [self.drawerView addSubview:self.carNumberLabel];
        [self.drawerView addSubview:self.carNumberField];
        [self.drawerView addSubview:self.carDLabel];
        [self.drawerView addSubview:self.carDTextField];
        [self.drawerView addSubview:self.zhTimeLabel];
        [self.drawerView addSubview:self.zhStartTimeButton];
        [self.drawerView addSubview:self.zhZhiLabel];
        [self.drawerView addSubview:self.zhEndTimeButton];
        [self.drawerView addSubview:self.xhTimeLabel];
        [self.drawerView addSubview:self.xhStatrTimeButton];
        [self.drawerView addSubview:self.xhZhiLabel];
        [self.drawerView addSubview:self.xhEndTimeButton];
        [self.drawerView addSubview:self.cwDKTimeLabel];
        [self.drawerView addSubview:self.cwDKStatrTimeButton];
        [self.drawerView addSubview:self.cwDKZhiLabel];
        [self.drawerView addSubview:self.cwDKTimeButton];
        [self.drawerView addSubview:self.topOlderTimeLabel];
        [self.drawerView addSubview:self.topOlderStatrTimeButton];
        [self.drawerView addSubview:self.topOlderZhiLabel];
        [self.drawerView addSubview:self.topOlderTimeButton];
        [self.drawerView addSubview:self.jiedanTimeLabel];
        [self.drawerView addSubview:self.jiedanStatrTimeButton];
        [self.drawerView addSubview:self.jiedanZhiLabel];
        [self.drawerView addSubview:self.jiedanTimeButton];
        [self.drawerView addSubview:self.resetrightButton];
        [self.drawerView addSubview:self.confirmButton];
        [self.drawerView addSubview:self.cancelButton];
    }
    return _drawerView;
}
-(UILabel *)titleLabel{
    if (_titleLabel == nil) {
        self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake((SCREEN_WIDTH - SCREEN_WIDTH/4)/2 - 25, kTabBarHeight, 50, 20)];
        self.titleLabel.text = @"筛选";
    }
    return _titleLabel;
}
-(UILabel *)linesLabel{
    if (_linesLabel == nil) {
        self.linesLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.titleLabel.frame) + 10, SCREEN_WIDTH - SCREEN_WIDTH/4, 1)];
        self.linesLabel.backgroundColor = [UIColor cjLineColor];
    }
    return _linesLabel;
}
-(UILabel *)nameLabel{
    if (_nameLabel == nil) {
        self.nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, CGRectGetMaxY(self.linesLabel.frame) + 20, 80, 40)];
        self.nameLabel.text = @"司机名称:";
        self.nameLabel.textColor = [UIColor cjMainTextColor];
        self.nameLabel.font = [UIFont systemFontOfSize:15];
    }
    return _nameLabel;
}
- (UITextField *)nameTextField{
    if (_nameTextField == nil) {
        self.nameTextField = [[UITextField alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.nameLabel.frame) + 10, CGRectGetMaxY(self.linesLabel.frame) + 20, 180, 40)];
//        self.nameTextField.delegate = self;
        self.nameTextField.font = [UIFont systemFontOfSize:13];
        self.nameTextField.textColor = [UIColor cjMainTextColor];
        self.nameTextField.placeholder = @"请输入司机名称";
        self.nameTextField.layer.masksToBounds = YES;
        self.nameTextField.layer.borderWidth = 1;
        self.nameTextField.layer.cornerRadius = 10;
        self.nameTextField.layer.borderColor = [[UIColor cjLineColor] CGColor];
    }
    return _nameTextField;
}
- (UILabel *)carNumberLabel{
    if (_carNumberLabel == nil) {
        self.carNumberLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, CGRectGetMaxY(self.nameLabel.frame) + 20, 80, 40)];
        self.carNumberLabel.text = @"车  牌  号:";
        self.carNumberLabel.textColor = [UIColor cjMainTextColor];;
        self.carNumberLabel.font = [UIFont systemFontOfSize:15];
    }
    return _carNumberLabel;
}
- (UITextField *)carNumberField{
    if (_carNumberField == nil) {
        self.carNumberField = [[UITextField alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.carNumberLabel.frame) + 10, CGRectGetMaxY(self.nameLabel.frame) + 20, 180, 40)];
//        self.carNumberField.delegate = self;
        self.carNumberField.textColor = [UIColor cjMainTextColor];
        self.carNumberField.font = [UIFont systemFontOfSize:13];
        self.carNumberField.placeholder = @"请输入车牌号";
        self.carNumberField.layer.masksToBounds = YES;
        self.carNumberField.layer.borderWidth = 1;
        self.carNumberField.layer.cornerRadius = 10;
        self.carNumberField.layer.borderColor = [[UIColor cjLineColor] CGColor];
    }
    return _carNumberField;
}
- (UILabel *)carDLabel{
    if (_carDLabel == nil) {
        self.carDLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, CGRectGetMaxY(self.carNumberLabel.frame) + 20, 80, 40)];
        self.carDLabel.text = @"车队名称:";
        self.carDLabel.textColor = [UIColor cjMainTextColor];;
        self.carDLabel.font = [UIFont systemFontOfSize:15];
    }
    return _carDLabel;
}
-(UITextField *)carDTextField{
    if (_carDTextField == nil) {
        self.carDTextField = [[UITextField alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.carDLabel.frame) + 10, CGRectGetMaxY(self.carNumberLabel.frame) + 20, 180, 40)];
//        self.zhAddreTextField.delegate = self;
        self.carDTextField.textColor = [UIColor cjMainTextColor];;
        self.carDTextField.font = [UIFont systemFontOfSize:15];
        self.carDTextField.placeholder = @"请输入车队名称";
        self.carDTextField.layer.masksToBounds = YES;
        self.carDTextField.layer.borderWidth = 1;
        self.carDTextField.layer.cornerRadius = 10;
        self.carDTextField.layer.borderColor = [[UIColor cjLineColor] CGColor];
    }
    return _carDTextField;
}
-(UILabel *)zhTimeLabel{
    if (!_zhTimeLabel) {
        self.zhTimeLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, CGRectGetMaxY(self.carDLabel.frame) + 20, 120, 30)];
        self.zhTimeLabel.text = @"实际装货时间:";
        self.zhTimeLabel.textColor = [UIColor cjMainTextColor];
        self.zhTimeLabel.font = [UIFont systemFontOfSize:15];
    }
    return _zhTimeLabel;
}
-(UIButton *)zhStartTimeButton{
    if (!_zhStartTimeButton) {
        self.zhStartTimeButton = [UIButton buttonWithType:(UIButtonTypeSystem)];
        self.zhStartTimeButton.frame = CGRectMake(10, CGRectGetMaxY(self.zhTimeLabel.frame), 120, 40);
        self.zhStartTimeButton.layer.masksToBounds = YES;
        self.zhStartTimeButton.layer.cornerRadius = 10;
        self.zhStartTimeButton.layer.borderWidth = 1;
        self.zhStartTimeButton.layer.borderColor = [[UIColor cjLineColor] CGColor];
        self.zhStartTimeButton.tag = 100;
        [self.zhStartTimeButton addTarget:self action:@selector(zhButtonAction:) forControlEvents:(UIControlEventTouchUpInside)];
        [self.zhStartTimeButton setTitleColor:[UIColor cjMainTextColor] forState:UIControlStateNormal];
        [self.zhStartTimeButton setTitle:@"装货开始时间" forState:UIControlStateNormal];
        self.zhStartTimeButton.titleLabel.font = [UIFont systemFontOfSize:12];
    }
    return _zhStartTimeButton;
}
-(UILabel *)zhZhiLabel{
    if (!_zhZhiLabel) {
        self.zhZhiLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.zhStartTimeButton.frame) + 5, CGRectGetMaxY(self.zhTimeLabel.frame), 30, 40)];
        self.zhZhiLabel.text = @"至";
        self.zhZhiLabel.textColor = [UIColor cjMainTextColor];
        self.zhZhiLabel.font = [UIFont systemFontOfSize:13];
        self.zhZhiLabel.textAlignment = NSTextAlignmentCenter;
    }
    return _zhZhiLabel;
}
-(UIButton *)zhEndTimeButton{
    if (!_zhEndTimeButton) {
        self.zhEndTimeButton = [UIButton buttonWithType:(UIButtonTypeSystem)];
        self.zhEndTimeButton.frame = CGRectMake(CGRectGetMaxX(self.zhZhiLabel.frame), CGRectGetMaxY(self.zhTimeLabel.frame), 120, 40);
        self.zhEndTimeButton.layer.masksToBounds = YES;
        self.zhEndTimeButton.layer.cornerRadius = 10;
        self.zhEndTimeButton.layer.borderWidth = 1;
        self.zhEndTimeButton.layer.borderColor = [[UIColor cjLineColor] CGColor];
        self.zhEndTimeButton.tag = 101;
        [self.zhEndTimeButton addTarget:self action:@selector(zhButtonAction:) forControlEvents:(UIControlEventTouchUpInside)];
        [self.zhEndTimeButton setTitleColor:[UIColor cjMainTextColor] forState:UIControlStateNormal];
        [self.zhEndTimeButton setTitle:@"装货结束时间" forState:UIControlStateNormal];
        self.zhEndTimeButton.titleLabel.font = [UIFont systemFontOfSize:12];
    }
    return _zhEndTimeButton;
}

-(UILabel *)xhTimeLabel{
    if (!_xhTimeLabel) {
        self.xhTimeLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, CGRectGetMaxY(self.zhStartTimeButton.frame) + 10, 120, 30)];
        self.xhTimeLabel.text = @"实际卸货时间:";
        self.xhTimeLabel.textColor = [UIColor cjMainTextColor];
        self.xhTimeLabel.font = [UIFont systemFontOfSize:15];
    }
    return _xhTimeLabel;
}
-(UIButton *)xhStatrTimeButton{
    if (!_xhStatrTimeButton) {
        self.xhStatrTimeButton = [UIButton buttonWithType:(UIButtonTypeSystem)];
        self.xhStatrTimeButton.frame = CGRectMake(10, CGRectGetMaxY(self.xhTimeLabel.frame), 120, 40);
        self.xhStatrTimeButton.layer.masksToBounds = YES;
        self.xhStatrTimeButton.layer.cornerRadius = 10;
        self.xhStatrTimeButton.layer.borderWidth = 1;
        self.xhStatrTimeButton.layer.borderColor = [[UIColor cjLineColor] CGColor];
        self.xhStatrTimeButton.tag = 102;
        [self.xhStatrTimeButton addTarget:self action:@selector(zhButtonAction:) forControlEvents:(UIControlEventTouchUpInside)];
        [self.xhStatrTimeButton setTitleColor:[UIColor cjMainTextColor] forState:UIControlStateNormal];
        [self.xhStatrTimeButton setTitle:@"卸货开始时间" forState:UIControlStateNormal];
        self.xhStatrTimeButton.titleLabel.font = [UIFont systemFontOfSize:12];
    }
    return _xhStatrTimeButton;
}
-(UILabel *)xhZhiLabel{
    if (!_xhZhiLabel) {
        self.xhZhiLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.xhTimeLabel.frame) + 5, CGRectGetMaxY(self.xhTimeLabel.frame), 30, 40)];
        self.xhZhiLabel.text = @"至";
        self.xhZhiLabel.textColor = [UIColor cjMainTextColor];
        self.xhZhiLabel.font = [UIFont systemFontOfSize:13];
        self.xhZhiLabel.textAlignment = NSTextAlignmentCenter;
    }
    return _xhZhiLabel;
}
-(UIButton *)xhEndTimeButton{
    if (!_xhEndTimeButton) {
        self.xhEndTimeButton = [UIButton buttonWithType:(UIButtonTypeSystem)];
        self.xhEndTimeButton.frame = CGRectMake(CGRectGetMaxX(self.xhZhiLabel.frame), CGRectGetMaxY(self.xhTimeLabel.frame), 120, 40);
        self.xhEndTimeButton.layer.masksToBounds = YES;
        self.xhEndTimeButton.layer.cornerRadius = 10;
        self.xhEndTimeButton.layer.borderWidth = 1;
        self.xhEndTimeButton.layer.borderColor = [[UIColor cjLineColor] CGColor];
        self.xhEndTimeButton.tag = 103;
        [self.xhEndTimeButton addTarget:self action:@selector(zhButtonAction:) forControlEvents:(UIControlEventTouchUpInside)];
        [self.xhEndTimeButton setTitleColor:[UIColor cjMainTextColor] forState:UIControlStateNormal];
        [self.xhEndTimeButton setTitle:@"卸货结束时间" forState:UIControlStateNormal];
        self.xhEndTimeButton.titleLabel.font = [UIFont systemFontOfSize:12];
    }
    return _xhEndTimeButton;
}

-(UILabel *)cwDKTimeLabel{
    if (!_cwDKTimeLabel) {
        self.cwDKTimeLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, CGRectGetMaxY(self.xhStatrTimeButton.frame) + 10, 120, 30)];
        self.cwDKTimeLabel.text = @"财务打款时间:";
        self.cwDKTimeLabel.textColor = [UIColor cjMainTextColor];
        self.cwDKTimeLabel.font = [UIFont systemFontOfSize:15];
    }
    return _cwDKTimeLabel;
}

-(UIButton *)cwDKStatrTimeButton{
    if (!_cwDKStatrTimeButton) {
        self.cwDKStatrTimeButton = [UIButton buttonWithType:(UIButtonTypeSystem)];
        self.cwDKStatrTimeButton.frame = CGRectMake(10, CGRectGetMaxY(self.cwDKTimeLabel.frame), 120, 40);
        self.cwDKStatrTimeButton.layer.masksToBounds = YES;
        self.cwDKStatrTimeButton.layer.cornerRadius = 10;
        self.cwDKStatrTimeButton.layer.borderWidth = 1;
        self.cwDKStatrTimeButton.layer.borderColor = [[UIColor cjLineColor] CGColor];
        self.cwDKStatrTimeButton.tag = 104;
        [self.cwDKStatrTimeButton addTarget:self action:@selector(zhButtonAction:) forControlEvents:(UIControlEventTouchUpInside)];
        [self.cwDKStatrTimeButton setTitleColor:[UIColor cjMainTextColor] forState:UIControlStateNormal];
        [self.cwDKStatrTimeButton setTitle:@"打款开始时间" forState:UIControlStateNormal];
        self.cwDKStatrTimeButton.titleLabel.font = [UIFont systemFontOfSize:12];
    }
    return _cwDKStatrTimeButton;
}
-(UILabel *)cwDKZhiLabel{
    if (!_cwDKZhiLabel) {
        self.cwDKZhiLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.cwDKStatrTimeButton.frame) + 5, CGRectGetMaxY(self.cwDKTimeLabel.frame), 30, 40)];
        self.cwDKZhiLabel.text = @"至";
        self.cwDKZhiLabel.textColor = [UIColor cjMainTextColor];
        self.cwDKZhiLabel.font = [UIFont systemFontOfSize:13];
        self.cwDKZhiLabel.textAlignment = NSTextAlignmentCenter;
    }
    return _cwDKZhiLabel;
}
-(UIButton *)cwDKTimeButton{
    if (!_cwDKTimeButton) {
        self.cwDKTimeButton = [UIButton buttonWithType:(UIButtonTypeSystem)];
        self.cwDKTimeButton.frame = CGRectMake(CGRectGetMaxX(self.cwDKZhiLabel.frame), CGRectGetMaxY(self.cwDKTimeLabel.frame), 120, 40);
        self.cwDKTimeButton.layer.masksToBounds = YES;
        self.cwDKTimeButton.layer.cornerRadius = 10;
        self.cwDKTimeButton.layer.borderWidth = 1;
        self.cwDKTimeButton.layer.borderColor = [[UIColor cjLineColor] CGColor];
        self.cwDKTimeButton.tag = 105;
        [self.cwDKTimeButton addTarget:self action:@selector(zhButtonAction:) forControlEvents:(UIControlEventTouchUpInside)];
        [self.cwDKTimeButton setTitleColor:[UIColor cjMainTextColor] forState:UIControlStateNormal];
        [self.cwDKTimeButton setTitle:@"打款结束时间" forState:UIControlStateNormal];
        self.cwDKTimeButton.titleLabel.font = [UIFont systemFontOfSize:12];
    }
    return _cwDKTimeButton;
}
-(UILabel *)topOlderTimeLabel{
    if (!_topOlderTimeLabel) {
        self.topOlderTimeLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, CGRectGetMaxY(self.cwDKStatrTimeButton.frame) + 10, 120, 30)];
        self.topOlderTimeLabel.text = @"下   单   时   间:";
        self.topOlderTimeLabel.textColor = [UIColor cjMainTextColor];
        self.topOlderTimeLabel.font = [UIFont systemFontOfSize:15];
    }
    return _topOlderTimeLabel;
}

-(UIButton *)topOlderStatrTimeButton{
    if (!_topOlderStatrTimeButton) {
        self.topOlderStatrTimeButton = [UIButton buttonWithType:(UIButtonTypeSystem)];
        self.topOlderStatrTimeButton.frame = CGRectMake( 10, CGRectGetMaxY(self.topOlderTimeLabel.frame) , 120, 40);
        self.topOlderStatrTimeButton.layer.masksToBounds = YES;
        self.topOlderStatrTimeButton.layer.cornerRadius = 10;
        self.topOlderStatrTimeButton.layer.borderWidth = 1;
        self.topOlderStatrTimeButton.layer.borderColor = [[UIColor cjLineColor] CGColor];
        self.topOlderStatrTimeButton.tag = 106;
        [self.topOlderStatrTimeButton addTarget:self action:@selector(zhButtonAction:) forControlEvents:(UIControlEventTouchUpInside)];
        [self.topOlderStatrTimeButton setTitleColor:[UIColor cjMainTextColor] forState:UIControlStateNormal];
        [self.topOlderStatrTimeButton setTitle:@"下单开始时间" forState:UIControlStateNormal];
        self.topOlderStatrTimeButton.titleLabel.font = [UIFont systemFontOfSize:12];
    }
    return _topOlderStatrTimeButton;
}
-(UILabel *)topOlderZhiLabel{
    if (!_topOlderZhiLabel) {
        self.topOlderZhiLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.topOlderStatrTimeButton.frame) + 5, CGRectGetMaxY(self.topOlderTimeLabel.frame), 30, 40)];
        self.topOlderZhiLabel.text = @"至";
        self.topOlderZhiLabel.textColor = [UIColor cjMainTextColor];
        self.topOlderZhiLabel.font = [UIFont systemFontOfSize:13];
        self.topOlderZhiLabel.textAlignment = NSTextAlignmentCenter;
    }
    return _topOlderZhiLabel;
}
-(UIButton *)topOlderTimeButton{
    if (!_topOlderTimeButton) {
        self.topOlderTimeButton = [UIButton buttonWithType:(UIButtonTypeSystem)];
        self.topOlderTimeButton.frame = CGRectMake(CGRectGetMaxX(self.topOlderZhiLabel.frame), CGRectGetMaxY(self.topOlderTimeLabel.frame), 120, 40);
        self.topOlderTimeButton.layer.masksToBounds = YES;
        self.topOlderTimeButton.layer.cornerRadius = 10;
        self.topOlderTimeButton.layer.borderWidth = 1;
        self.topOlderTimeButton.layer.borderColor = [[UIColor cjLineColor] CGColor];
        self.topOlderTimeButton.tag = 107;
        [self.topOlderTimeButton addTarget:self action:@selector(zhButtonAction:) forControlEvents:(UIControlEventTouchUpInside)];
        [self.topOlderTimeButton setTitleColor:[UIColor cjMainTextColor] forState:UIControlStateNormal];
        [self.topOlderTimeButton setTitle:@"下单结束时间" forState:UIControlStateNormal];
        self.topOlderTimeButton.titleLabel.font = [UIFont systemFontOfSize:12];
    }
    return _topOlderTimeButton;
}
-(UILabel *)jiedanTimeLabel{
    if (!_jiedanTimeLabel) {
        self.jiedanTimeLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, CGRectGetMaxY(self.topOlderStatrTimeButton.frame) + 20, 120, 30)];
        self.jiedanTimeLabel.text = @"接   单   时   间:";
        self.jiedanTimeLabel.textColor = [UIColor cjMainTextColor];
        self.jiedanTimeLabel.font = [UIFont systemFontOfSize:15];
    }
    return _jiedanTimeLabel;
}
-(UIButton *)jiedanStatrTimeButton{
    if (!_jiedanStatrTimeButton) {
        self.jiedanStatrTimeButton = [UIButton buttonWithType:(UIButtonTypeSystem)];
        self.jiedanStatrTimeButton.frame = CGRectMake(10, CGRectGetMaxY(self.jiedanTimeLabel.frame), 120, 40);
        self.jiedanStatrTimeButton.layer.masksToBounds = YES;
        self.jiedanStatrTimeButton.layer.cornerRadius = 10;
        self.jiedanStatrTimeButton.layer.borderWidth = 1;
        self.jiedanStatrTimeButton.layer.borderColor = [[UIColor cjLineColor] CGColor];
        self.jiedanStatrTimeButton.tag = 108;
        [self.jiedanStatrTimeButton addTarget:self action:@selector(zhButtonAction:) forControlEvents:(UIControlEventTouchUpInside)];
        [self.jiedanStatrTimeButton setTitleColor:[UIColor cjMainTextColor] forState:UIControlStateNormal];
        [self.jiedanStatrTimeButton setTitle:@"接单开始时间" forState:UIControlStateNormal];
        self.jiedanStatrTimeButton.titleLabel.font = [UIFont systemFontOfSize:12];
    }
    return _jiedanStatrTimeButton;
}
-(UILabel *)jiedanZhiLabel{
    if (!_jiedanZhiLabel) {
        self.jiedanZhiLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.jiedanStatrTimeButton.frame) + 5, CGRectGetMaxY(self.jiedanTimeLabel.frame), 30, 40)];
        self.jiedanZhiLabel.text = @"至";
        self.jiedanZhiLabel.textColor = [UIColor cjMainTextColor];
        self.jiedanZhiLabel.font = [UIFont systemFontOfSize:13];
        self.jiedanZhiLabel.textAlignment = NSTextAlignmentCenter;
    }
    return _jiedanZhiLabel;
}
-(UIButton *)jiedanTimeButton{
    if (!_jiedanTimeButton) {
        self.jiedanTimeButton = [UIButton buttonWithType:(UIButtonTypeSystem)];
        self.jiedanTimeButton.frame = CGRectMake(CGRectGetMaxX(self.jiedanZhiLabel.frame) + 5, CGRectGetMaxY(self.jiedanTimeLabel.frame) , 120, 40);
        self.jiedanTimeButton.layer.masksToBounds = YES;
        self.jiedanTimeButton.layer.cornerRadius = 10;
        self.jiedanTimeButton.layer.borderWidth = 1;
        self.jiedanTimeButton.layer.borderColor = [[UIColor cjLineColor] CGColor];
        self.jiedanTimeButton.tag = 109;
        [self.jiedanTimeButton addTarget:self action:@selector(zhButtonAction:) forControlEvents:(UIControlEventTouchUpInside)];
        [self.jiedanTimeButton setTitleColor:[UIColor cjMainTextColor] forState:UIControlStateNormal];
        [self.jiedanTimeButton setTitle:@"接单结束时间" forState:UIControlStateNormal];
        self.jiedanTimeButton.titleLabel.font = [UIFont systemFontOfSize:12];
    }
    return _jiedanTimeButton;
}
- (UIButton *)resetrightButton{
    if (!_resetrightButton) {
        self.resetrightButton = [UIButton buttonWithType:(UIButtonTypeSystem)];
        self.resetrightButton.frame = CGRectMake(SCREEN_WIDTH - 100 - SCREEN_WIDTH/4, kTabBarHeight, 80, 25);
        [self.resetrightButton addTarget:self action:@selector(resetrightAction) forControlEvents:(UIControlEventTouchUpInside)];
        [self.resetrightButton setTitleColor:[UIColor cjMainColorText] forState:UIControlStateNormal];
        [self.resetrightButton setTitle:@"重置" forState:UIControlStateNormal];

    }
    return _resetrightButton;
}
- (UIButton *)confirmButton{
    if (!_confirmButton) {
        self.confirmButton = [UIButton buttonWithType:(UIButtonTypeSystem)];
        self.confirmButton.frame = CGRectMake(CGRectGetMaxX(self.cancelButton.frame) + 20, SCREEN_HEIGHT - 80, (SCREEN_WIDTH/4*3 - 60)/2, 50);
        [self.confirmButton addTarget:self action:@selector(confirmButtonAction) forControlEvents:(UIControlEventTouchUpInside)];
        [self.confirmButton setTitleColor:[UIColor cjMainColorText] forState:UIControlStateNormal];
        [self.confirmButton setTitle:@"确定" forState:UIControlStateNormal];
        self.confirmButton.layer.masksToBounds = YES;
        self.confirmButton.layer.cornerRadius = 10;
        self.confirmButton.layer.borderWidth = 1;
        self.confirmButton.layer.borderColor = [[UIColor cjLineColor] CGColor];
    }
    return _confirmButton;
}
- (UIButton *)cancelButton{
    if (!_cancelButton) {
        self.cancelButton = [UIButton buttonWithType:(UIButtonTypeSystem)];
        self.cancelButton.frame = CGRectMake( 20, SCREEN_HEIGHT - 80, (SCREEN_WIDTH/4*3 - 60)/2, 50);
        [self.cancelButton addTarget:self action:@selector(cancelButtonAction) forControlEvents:(UIControlEventTouchUpInside)];
        [self.cancelButton setTitleColor:[UIColor cjMainColorText] forState:UIControlStateNormal];
        [self.cancelButton setTitle:@"取消" forState:UIControlStateNormal];
        self.cancelButton.layer.masksToBounds = YES;
        self.cancelButton.layer.cornerRadius = 10;
        self.cancelButton.layer.borderWidth = 1;
        self.cancelButton.layer.borderColor = [[UIColor cjLineColor] CGColor];
    }
    return _cancelButton;
}
- (void)changeVoidceSet:(UITapGestureRecognizer *)sender {
    CGPoint location = [sender locationInView:self.bgView];
//    DebugLog(@"--x:%f    y:%f",location.x,location.y);
    if (location.x <= SCREEN_WIDTH/4) {
        self.blokHidden();
    }else{
        [self.nameTextField resignFirstResponder];
        [self.carNumberField resignFirstResponder];
        [self.carDTextField resignFirstResponder];

    }

}
- (void)cancelButtonAction{
    self.blokHidden();
}
- (void)resetrightAction{
    [self endEditing:YES];
    self.nameTextField.text = @"";
    self.carNumberField.text = @"";
    self.carDTextField.text = @"";
    [self.zhStartTimeButton setTitle:@"装货开始时间" forState:(UIControlStateNormal)];
    [self.zhEndTimeButton setTitle:@"装货结束时间" forState:(UIControlStateNormal)];
    [self.xhStatrTimeButton setTitle:@"卸货开始时间" forState:(UIControlStateNormal)];
    [self.xhEndTimeButton setTitle:@"卸货结束时间" forState:(UIControlStateNormal)];
    [self.cwDKStatrTimeButton setTitle:@"打款开始时间" forState:(UIControlStateNormal)];
    [self.cwDKTimeButton setTitle:@"打款结束时间" forState:(UIControlStateNormal)];
    [self.topOlderStatrTimeButton setTitle:@"下单开始时间" forState:(UIControlStateNormal)];
    [self.topOlderTimeButton setTitle:@"下单结束时间" forState:(UIControlStateNormal)];
    [self.jiedanStatrTimeButton setTitle:@"接单开始时间" forState:(UIControlStateNormal)];
    [self.jiedanTimeButton setTitle:@"接单结束时间" forState:(UIControlStateNormal)];

    
    [self.dict setValue:@"" forKey:@"driverName"];
    [self.dict setValue:@"" forKey:@"vehicleLicense"];
    [self.dict setValue:@"" forKey:@"teamName"];
    [self.dict setValue:@"" forKey:@"fillTimeStart"];
    [self.dict setValue:@"" forKey:@"fillTimeEnd"];
    [self.dict setValue:@"" forKey:@"signTimeStart"];
    [self.dict setValue:@"" forKey:@"signTimeEnd"];
    [self.dict setValue:@"" forKey:@"gmtModifiedStart"];
    [self.dict setValue:@"" forKey:@"gmtModifiedEnd"];
    [self.dict setValue:@"" forKey:@"orderGmtCreatedStart"];
    [self.dict setValue:@"" forKey:@"orderGmtCreatedEnd"];
    [self.dict setValue:@"" forKey:@"gmtCreatedStart"];
    [self.dict setValue:@"" forKey:@"gmtCreatedEnd"];
    self.clearDataBlock(self.dict);
}
- (void)confirmButtonAction{
    self.dict = [NSMutableDictionary dictionary];
    [self.dict setValue:self.nameTextField.text forKey:@"driverName"];
    [self.dict setValue:self.carNumberField.text forKey:@"vehicleLicense"];
    [self.dict setValue:self.carDTextField.text forKey:@"teamName"];
    if (([self.zhStartTimeButton.titleLabel.text  isEqualToString: @"装货开始时间"])) {
        [self.dict setValue:@"" forKey:@"fillTimeStart"];
    }else {
        [self.dict setValue:self.zhStartTimeButton.titleLabel.text forKey:@"fillTimeStart"];
    }
    if (([self.zhEndTimeButton.titleLabel.text  isEqualToString: @"装货结束时间"])) {
        [self.dict setValue:@"" forKey:@"fillTimeEnd"];
    }else {
        [self.dict setValue:self.zhEndTimeButton.titleLabel.text forKey:@"fillTimeEnd"];
    }
    if (([self.xhStatrTimeButton.titleLabel.text  isEqualToString: @"卸货开始时间"])) {
        [self.dict setValue:@"" forKey:@"signTimeStart"];
    }else{
        [self.dict setValue:self.xhStatrTimeButton.titleLabel.text forKey:@"signTimeStart"];
    }
    if (([self.xhEndTimeButton.titleLabel.text  isEqualToString: @"卸货结束时间"])) {
        [self.dict setValue:@"" forKey:@"signTimeEnd"];
    }else{
        [self.dict setValue:self.xhEndTimeButton.titleLabel.text forKey:@"signTimeEnd"];
    }
    if (([self.cwDKStatrTimeButton.titleLabel.text  isEqualToString: @"打款开始时间"])) {
        [self.dict setValue:@"" forKey:@"gmtModifiedStart"];
    }else{
        [self.dict setValue:self.cwDKStatrTimeButton.titleLabel.text forKey:@"gmtModifiedStart"];
    }
    if (([self.cwDKTimeButton.titleLabel.text  isEqualToString: @"打款结束时间"])) {
        [self.dict setValue:@"" forKey:@"gmtModifiedEnd"];
    }else{
        [self.dict setValue:self.cwDKTimeButton.titleLabel.text forKey:@"gmtModifiedEnd"];
    }
    if (([self.topOlderStatrTimeButton.titleLabel.text  isEqualToString: @"下单开始时间"])) {
        [self.dict setValue:@"" forKey:@"orderGmtCreatedStart"];
    }else{
        [self.dict setValue:self.topOlderStatrTimeButton.titleLabel.text forKey:@"orderGmtCreatedStart"];
    }
    if (([self.topOlderTimeButton.titleLabel.text  isEqualToString: @"下单结束时间"])) {
        [self.dict setValue:@"" forKey:@"orderGmtCreatedEnd"];
    }else{
        [self.dict setValue:self.topOlderTimeButton.titleLabel.text forKey:@"orderGmtCreatedEnd"];
    }
    if (([self.jiedanStatrTimeButton.titleLabel.text  isEqualToString: @"接单开始时间"])) {
        [self.dict setValue:@"" forKey:@"gmtCreatedStart"];
    }else{
        [self.dict setValue:self.jiedanStatrTimeButton.titleLabel.text forKey:@"gmtCreatedStart"];
    }
    if (([self.jiedanTimeButton.titleLabel.text  isEqualToString: @"接单结束时间"])) {
        [self.dict setValue:@"" forKey:@"gmtCreatedEnd"];
    }else{
        [self.dict setValue:self.jiedanTimeButton.titleLabel.text forKey:@"gmtCreatedEnd"];
    }
    self.confirmBlock(self.dict);
}

- (void)zhButtonAction:(UIButton *)btn{
    [self.nameTextField resignFirstResponder];
    [self.carNumberField resignFirstResponder];
    [self.carDTextField resignFirstResponder];
    WS(ws);
    BRDatePickerView *datePickerView = [[BRDatePickerView alloc]initWithPickerMode:BRDatePickerModeYMD];
    datePickerView.title = @"请选择时间 ";
    datePickerView.minDate = [NSDate br_setYear:2016 month:5 day:1];
    datePickerView.maxDate = [NSDate date];  //[NSDate br_setYear:2050 month:5 day:1];
    datePickerView.resultBlock = ^(NSString *selectValue) {
        if(btn.tag == 100){
            [ws.zhStartTimeButton setTitle:selectValue forState:(UIControlStateNormal)];
        }else if (btn.tag == 101){
            [ws.zhEndTimeButton setTitle:selectValue forState:(UIControlStateNormal)];
        }else if (btn.tag == 102){
            [ws.xhStatrTimeButton setTitle:selectValue forState:(UIControlStateNormal)];
        }else if (btn.tag == 103){
            [ws.xhEndTimeButton setTitle:selectValue forState:(UIControlStateNormal)];
        }else if (btn.tag == 104){
            [ws.cwDKStatrTimeButton setTitle:selectValue forState:(UIControlStateNormal)];
        }else if (btn.tag == 105){
            [ws.cwDKTimeButton setTitle:selectValue forState:(UIControlStateNormal)];
        }else if (btn.tag == 106){
            [ws.topOlderStatrTimeButton setTitle:selectValue forState:(UIControlStateNormal)];
        }else if (btn.tag == 107){
            [ws.topOlderTimeButton setTitle:selectValue forState:(UIControlStateNormal)];
        }else if (btn.tag == 108){
            [ws.jiedanStatrTimeButton setTitle:selectValue forState:(UIControlStateNormal)];
        }else if (btn.tag == 109){
            [ws.jiedanTimeButton setTitle:selectValue forState:(UIControlStateNormal)];
        }
       
    };
    BRPickerStyle *customStyle = [BRPickerStyle pickerStyleWithThemeColor:[UIColor cjMainColor]];
    datePickerView.pickerStyle = customStyle;
    [datePickerView show];
}
@end
